
<template>
  <div class="effet-model-bg" v-if="show">
    <div class="effet-model" v-loading="loading">
      <div class="effet-model-title">
        <span>{{title}}影像报告</span>
        <span class="el-icon-circle-close close" @click="closeModel"></span>
      </div>
      <iframe :src="iframeSrc" frameborder="0" style="height:100%;width:100%;box-sizing: border-box;"></iframe>
    </div>
  </div>
</template>

<script>
let LocationHostName = window.location.hostname;
export default {
  props:{
    id:{
      type: [Number,String],
      default:''
    },
    title:{
      type: String,
      default:'用户'
    },
    show:{
      type: Boolean,
      default:false
    }
  },
  name: "effect",
  data() {
    return {
      loading:false,
      iframeSrc: LocationHostName === 'localhost'?'https://lanyingsup.zrs360.vip/public/toDicom.html':`${window.location.origin}/public/toDicom.html`,
    };
  },
  watch:{
    show:function(val){
      if(val){
        this.loading=true;
        this.iframeShow()
      }
    }
  },
  created() {
    
  },
  methods: {
    closeModel(){
      this.$emit('update:show',false)
    },
    iframeShow(){
      setTimeout(()=>{
        this.loading=false;
      },3000)
    }
  }
};
</script>

<style scoped>
.effet-model-bg{
  position: fixed;
  top:0;
  left:0;
  z-index: 100;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:rgba(0,0,0,.5)
}
.effet-model {
  width: 95%;
  height: 95%;
  padding:30px 20px 20px 20px;
  background: #eee;
  border-radius: 8px;
  box-shadow: 1px 1px 4px -2px #000;
  position: relative;
}
.effet-model-title{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding:0 20px;
  height: 30px;
  position: absolute;
  top:0;
  left:0;
  width: 100%;
  font-size: 14px;
  color:#333;
}
.close{
  font-size: 28px;
  font-weight: bold;
}
.close:hover{
  cursor: pointer;
  color:blue;
}
</style>
